import React, { useEffect } from 'react';
import { Terminal } from 'xterm';

export default () => {
  useEffect(() => {
    const term = new Terminal();
    const dom = document.getElementById('terminal-container');
    term.open(dom as HTMLElement);
    return () => {
      term.dispose();
    };
  });
  return <div id="terminal-container"></div>;
};
